package com.bgl.mall.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.bgl.mall.common.ServerResponse;
import com.bgl.mall.pojo.Shipping;
import com.github.pagehelper.PageInfo;

/**
 * Created by BGL on 2017/8/15.
 */
public interface IShippingService extends IService<Shipping> {
    /**
     * 新增收货地址
     * @param userId
     * @param shipping
     * @return
     */
    ServerResponse add(Integer userId, Shipping shipping);

    /**
     * 删除收货地址
     * @param userId
     * @param shippingId
     * @return
     */
    ServerResponse<String> delete(Integer userId, Integer shippingId);

    /**
     * 更新收货地址
     * @param userId
     * @param shipping
     * @return
     */
    ServerResponse update(Integer userId, Shipping shipping);

    /**
     * 查询收货地址
     * @param userId
     * @param shippingId
     * @return
     */
    ServerResponse<Shipping> select(Integer userId, Integer shippingId);

    /**
     * 分页查询收货地址列表
     * @param userId
     * @param pageNum
     * @param pageSize
     * @return
     */
    ServerResponse<PageInfo> list(Integer userId, int pageNum, int pageSize);
}
